﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;

namespace ObjectModel.Excel
{
    public class ResolvableLookUpStepRange : ResolvableRange
    {
        public override ResolvableWorkbook Workbook { get; set; }

        public string WorksheetName { get; set; } 

        public LookUpSteps LookUpSteps { get; set; }

        public ResolvableLookUpStepRange() { } // Parameterless constructor required for serialization.

        public override Range Resolve()
        {
            Workbook wb = Workbook.Resolve();
            Worksheet ws = wb.GetWorksheetFromName(WorksheetName);
            return LookUpSteps.ResolveInWorksheet(ws);
        }
    }
}
